<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8">
    <title>主页</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link media="all" rel="stylesheet" th:href="@{../../lib/layui/css/layui.css}">
    <link media="all" rel="stylesheet" th:href="@{../../css/xadmin.css}">
    <script th:src="@{../../lib/layui/layui.js}"></script>
    <script th:src="@{../../js/jquery-3.5.1.min.js}"></script>
    <style>
        body .auth {border: 1px solid yellowgreen; border-radius: 10px;}
        body .auth .layui-layer-title{background: #c65520; color:#fff; border: none;}
    </style>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">
            <button class="layui-btn" onclick="change('welcome')" type="button">后台管理系统</button>
        </div>
        <!-- 头部区域（可配合layui已有的水平导航） -->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a>
                    <img alt=""
                         class="layui-nav-img" src="" th:src="@{../../images/userLogo.jpg}">
                    [[${session.loginInfo.userName}]]
                </a>
                <dl class="layui-nav-child" id="operationEnum">
                    <dd><a href="javascript:" onclick="change('info')">基本资料</a></dd>
                    <dd><a href="javascript:" id="adminAuth">用户管理</a></dd>
                    <dd><a th:href="@{/admin/quit}">退出登录</a></dd>
                </dl>
            </li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree" lay-filter="test">
                <li class="layui-nav-item">
                    <a class="" href="javascript:">建筑楼宇信息</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:" onclick="change('pbbiList')">公共楼宇</a></dd>
                        <dd><a href="javascript:" onclick="change('dbbiList_relax')">宿舍楼宇</a></dd>
                        <dd><a href="javascript:" onclick="change('dbbiList_eat')">食堂楼宇</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:">室外后勤信息</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:">文件上传</a></dd>
                        <dd><a href="javascript:">列表二</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:">动力供应信息</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:">文件上传</a></dd>
                        <dd><a href="javascript:">列表二</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:">学生基础信息</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:">文件上传</a></dd>
                        <dd><a href="javascript:">列表二</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
                <li class="layui-nav-item">
                    <a href="javascript:">关于我们</a>
                    <dl class="layui-nav-child">
                        <dd><a href="javascript:">文件上传</a></dd>
                        <dd><a href="javascript:">列表二</a></dd>
                        <dd><a href="">超链接</a></dd>
                    </dl>
                </li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div style="padding: 15px;">
            <iframe id="main" frameborder="0" height="800px" th:src="@{/sys/welcome}" width="99%"></iframe>
        </div>
    </div>

    <div class="layui-footer">
        <!-- 底部固定区域 -->
        <a href="https://zwc.xauat.edu.cn/" style="color: black" target="_blank">版权所有　© 西安建筑科技大学总务处</a>
    </div>
</div>
<script>
    //JavaScript代码区域
    layui.use(['element', 'layer', 'jquery'], function () {
        var element = layui.element,
            $ = layui.jquery,
            layer = layui.layer;
        $("#adminAuth").click(function () {
            layer.open({
                type: 2,
                title: '身份验证',
                area: ['500px', '50%'],
                shade: [0.5],
                content: 'authon_admin.html',
                loading: true,
                closeBtn: 1,
                skin: 'auth',
                cancel: function (index) {
                    layer.close(index);
                }
            });
        });
    });

    // 页面选择器
    function change(title) {
        let url = "";
        switch (title) {
            case "welcome":
                url = "/sys/welcome"
                break;
            case "info":
                url = "/admin/info";
                break;
            case "pbbiList":
                url = "/pbbi/pbbi_list";
                break;
            case "dbbiList_relax":
                url = "/dbbi_relax/dbbi_list_relax";
                break;
            case "dbbiList_eat":
                url = "/dbbi_eat/dbbi_list_eat";
        }
        $("iframe").attr("src", url);
    }

</script>
</body>
</html>
